package signGrammar;

import java.awt.Graphics;
import java.awt.Point;

public class CBlankShape implements IShape{

	private Point head, tail;
	private int dx, dy;
	public CBlankShape(Point head, Point tail) {
		this.head = head;
		this.tail = tail;
		this.dx = tail.x - head.x;
		this.dy = tail.y - head.y;
	}
	
	public CBlankShape(IShape s){
		this(s.getHead(),s.getTail());
	}

	@Override
	public IShape cloneForHead(Point headPoint) {
		return new CBlankShape( headPoint, new Point(headPoint.x + dx, headPoint.y + dy) );
	}

	@Override
	public IShape cloneForTail(Point tailPoint) {
		return new CBlankShape( new Point(tailPoint.x - dx, tailPoint.y - dy), tailPoint );
	}

	@Override
	public Point getHead() {
		return head;
	}

	@Override
	public Point getTail() {
		return tail;
	}

	@Override
	public IShape print(Graphics graphics) {
		return this;
	}

}
